# _*_ coding : utf-8 _*_
# @Time : 2025/11/3 10:16
# @Author : yjh
# @fileName : api.py
from http.client import responses

import requests
from cms_config.config import *

class Cms(object):

    def __init__(self):
        self.session = requests.session()

    def login(self):
        response = self.session.post(url=login_url,data=login_data,headers=login_headers)
        return response.json()

    def loginFailure(self):
        response = self.session.post(url=login_url, data=loginFailure_data, headers=login_headers)
        return response.json()

    def queryUserList(self):
        response = self.session.post(url=queryUserList_url,data=queryUserList_data,headers=queryUserList_headers)
        return response.json()

    def addUser(self):
        response = self.session.post(url=addUser_url,data=addUser_data,headers=addUser_headers)
        return response.json()

    def addUserFailure(self):
        response = self.session.post(url=addUser_url,data=addUserFailure_data,headers=addUser_headers)
        return response.json()

    def deleteUser(self):
        response = self.session.post(url=deleteUser_url,data=deleteUser_data,headers=deleteUser_headers)
        return response.json()

    def updateUserStatus(self):
        response = requests.session().post(url=updateUserStatus_url,data=updateUserStatus_data,headers=updateUserStatus_headers)
        return response.json()

    def updateUserInformation(self):
        response = requests.session().post(url=updateUserInformation_url,data=updateUserInformation_data,headers=updateUserInformation_headers)
        return response.json()

if __name__ == '__main__':
    nasa = Cms()

    print(nasa.login())
    print(nasa.queryUser())
    print(nasa.addUser())